home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Utilities / Workspace / Locus / Source / VersionInfo.m < prev    next >
Text File  |  1995-06-12  |  2KB  |  81 lines

  1.  
  2. /*
  3.     Copyright 1993  Jeremy Slade.
  4.  
  5.     You are free to use all or any parts of the Locus project
  6.     however you wish, just give credit where credit is due.
  7.     The author (Jeremy Slade) shall not be held responsible
  8.     for any damages that result out of use or misuse of any
  9.     part of this project.
  10.  
  11. */
  12.  
  13. /*
  14.     Project: Locus
  15.  
  16.     File: VersionInfo.h
  17.  
  18.     Description: See VersionInfo.h
  19.     
  20.     Original Author: Jeremy Slade
  21.  
  22.     Revision History:
  23.         Created
  24.             V.101    JGS    Mon Feb  1 22:38:17 GMT-0700 1993
  25.  
  26. */
  27.  
  28. #import "VersionInfo.h"
  29. #import <stdio.h>
  30.  
  31.  
  32. /*
  33.     Project version has format RMmrr where:
  34.         R  = Release type:
  35.             1 = Alpha Release
  36.             2 = Beta Release
  37.             3 = Market Release
  38.         M = Major Release number
  39.         m = Minor Release number
  40.         rr = Revision number
  41. */
  42. #import "VersionInfo.data.h"
  43.  
  44.  
  45. const char *releaseString[] = { "", " Alpha", " Beta", NULL };
  46.  
  47. const char *compileTimeStr = V_CompileTime;
  48.     // Adding a reference to V_CompileTime will cause the string
  49.     // to be hard-coded into the binary when it is compiled.  This
  50.     // is done simply so that this string will be in the binary
  51.  
  52.  
  53. @implementation Object ( VersionInfo )
  54.  
  55. + (int)projectVersion
  56. /*
  57.     Return the integer representation of the current project version
  58. */
  59. {
  60.     return ( V_VersionNum );
  61. }
  62.  
  63.  
  64.  
  65. + (const char *)projectVersionString
  66. /*
  67.     Return the string representation of the current project version
  68. */
  69. {
  70.     static char buf[1024] = "";
  71.     
  72.     if ( !(*buf ) ) { // Hasn't be init'd yet
  73.         sprintf ( buf, "Version %d.%d%s (r%d)", V_MajorVersion, V_MinorVersion,
  74.             releaseString[V_ReleaseType] ? releaseString[V_ReleaseType] : "",
  75.             V_Revision );
  76.     }
  77.     return ( buf );
  78. }
  79.  
  80. @end
  81.